---
name: 2-table模板
route: /steps/table
---
import { Playground, Props } from "docz";

# table模板
CCMS表单提交模板
常用的提交表单项 <br/>

## 表单提交展示
import Table, { PropsType } from "./";

<Playground>
  <Table
    data={
      {
      0:[{ 
          text: "文本信息",
          number: 20,
          datetimeRange: "2020-10,2020-11",
          datetime: new Date(),
          multirowText: '1,2,3',
          numberRange: '10,100'
        }]
      }
    }
    config={
      {
        primary: "index",
        operations: {
          rowOperations:[
            {
              type: 'button',
              label: 'test',
              handle: {
                type: 'ccms',
                page: 'test',
                target: 'current'
              },
              confirm: {
                enable:true,
                titleText:'111'
              }
            }
          ],
          tableOperations:[
            {
              type: 'button',
              label: 'test',
              handle: {
                type: 'ccms',
                page: 'test',
                target: 'current'
              }
            }
          ]
        },
        columns:[
          {
            label: "文本",
            field: "text",
            type: "text",
            defaultValue: "暂无数据"
          },
          {
            label: "多行文本",
            field: "multirowText",
            type: "multirowText",
            defaultValue: "暂无数据"
          },
          {
            label: "数值",
            field: "number",
            type: "number"
          },
          {
            label: "数值范围",
            field: "numberRange",
            type: "numberRange",
            defaultValue: "暂无数据"
          },
          {
            label: "时间",
            field: "datetime",
            type: "datetime",
            format: "YYYY-MM"
          },
          {
            label: "时间范围",
            field: "datetimeRange",
            type: "datetimeRange",
            format: "YYYY-MM-DD",
            split: '~'
          },
          {
            label: "选项",
            field: "enumInfo",
            type: "Aenum",
            defaultValue: "暂无数据",
            valueType: "string",
            multiple:{
              type: "array"
            },
            options: {
              from: "manual",
              data: [
                {
                  value: "dropdown",
                  label: "下拉选框"
                },
                {
                  value: "checkbox",
                  label: "复选框"
                }
              ]
            }
          }
        ]
      }
    }
    step={0}
    onSubmit={()=>{}}
    onUnmount={()=>{}}
    onMount={()=>{}}
    ref={(form) => {
      form.willMount()
    }}
  />
</Playground>

*****

## APIs- 模板默认值

 <Props of={PropsType} />